﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SyndicateDAO.DAO;
using SyndicateDAO.DatabaseObject;

namespace SyndicateBusiness.Classes
{
    public class PlayerBL
    {
        PlayerDAO PlayerDAO = new PlayerDAO();

        public IQueryable<player> GetAllByDrawId(int dId)
        {
            return PlayerDAO.SelectAllByDrawId(dId);
        }
        public bool InsertPlayer(player l)
        {
            return PlayerDAO.Insert(l);
        }
        public bool UpdatePlayer()
        {
            return PlayerDAO.Update();
        }
        public bool DeletePlayer(player l)
        {
            return PlayerDAO.Delete(l);
        }

        public IQueryable<player> GetAll()
        {
            return this.PlayerDAO.SelectAll();
        }

        public IQueryable<player> GetAll(DataContext dc)
        {
            return this.PlayerDAO.SelectAll(dc);
        }

        public IQueryable<draw> GetDrawsByPlayerId(int pId)
        {
            return PlayerDAO.SelectDrawsByPlayerId(pId);
        }
    }
}
